<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('开通底薪计划代理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <input type="hidden" name="type" value="0,4">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 100px;">代理商编号：</label>
                                <input type="text" name="agentNum"/>
                            </li>
                            <li>
                                <label style="width: 100px;">所属代理编号：</label>
                                <input type="text" name="belongAgent"/>
                            </li>
                            <li>
                                <label style="width: 100px;">代理商名称：</label>
                                <input type="text" name="agentName"/>
                            </li>
                            <li>
                                <label style="width: 100px;">代理商档位：</label>
                                <select name="grade">
                                    <option value="">请选择</option>
                                    <option value="V1">V1</option>
                                    <option value="V2">V2</option>
                                    <option value="V3">V3</option>
                                    <option value="V4">V4</option>
                                    <option value="V5">V5</option>
                                    <option value="V6">V6</option>
                                    <option value="V7">V7</option>
                                    <option value="V8">V8</option>
                                    <option value="V9">V9</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 100px;">报名时间：</label>
                                <input type="text" class="time-input" readonly placeholder="开始时间" name="start"/>
                                <span>-</span>
                                <input type="text" class="time-input" readonly placeholder="结束时间" name="end"/>
                            </li>
                            <li>
                                <label style="width: 10px;"></label>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
             <!--   <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="salaryPlan:agentActivityOpen:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="salaryPlan:agentActivityOpen:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="salaryPlan:agentActivityOpen:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="salaryPlan:agentActivityOpen:export">
                    <i class="fa fa-download"></i> 导出
                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('salaryPlan:agentActivityOpen:edit')}]];
        var removeFlag = [[${@permission.hasPermi('salaryPlan:agentActivityOpen:remove')}]];
        var prefix = ctx + "salaryPlan/agentActivityOpen";
        var posDetailsPrefix = ctx + "terminal/branchPos";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "开通底薪计划代理",
                firstLoad:false,
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                {
                    field: 'agentNum',
                    title: '代理商编号'
                },
                {
                    field: 'agentName',
                    title: '代理商名称'
                },
                {
                    field: 'grade',
                    title: '代理商档位'
                },
                {
                    field: 'belongAgent',
                    title: '所属代理编号'
                },
                {
                    field: 'month',
                    title: '报名月份'
                },
                {
                    field: 'startDate',
                    title: '报名时间'
                },
                {
                    field: 'endDate',
                    title: '结束时间'
                },
                  /*  {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.agentNum + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                            return actions.join('');
                        }
                    }*/]
            };
            $.table.init(options);
        });

        function detail(agentNum){
            var url = posDetailsPrefix + '/traditionPos?agentNum=' + agentNum + "&type=" + $("input[name='type']").val();
            $.modal.openTab("终端详情", url);
        }

    </script>
</body>
</html>